﻿using System.Collections.Generic;
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;

namespace Language.Intellisense.QuickInfo
{
    [Export( typeof( IIntellisenseControllerProvider ) )]
    [Name( "ToolTip QuickInfo Controller" )]
    [ContentType( "redscript" )]
    internal class ControllerProvider : IIntellisenseControllerProvider
    {
        #region Imports

        [Import]
        internal IQuickInfoBroker QuickInfoBroker { get; set; }

        #endregion Imports

        #region IIntellisenseControllerProvider

        IIntellisenseController IIntellisenseControllerProvider.TryCreateIntellisenseController( ITextView textView, IList<ITextBuffer> subjectBuffers )
        {
            return new Controller( textView, subjectBuffers, QuickInfoBroker );
        }

        #endregion IIntellisenseControllerProvider
    }
}
